//
//  SISSMyBrokerageCell.m
//  SISSAPP
//
//  Created by 袁应荣 on 2018/4/8.
//  Copyright © 2018年 优房网. All rights reserved.
//

#import "SISSMyBrokerageCell.h"

@interface SISSMyBrokerageCell ()

/// titleLabel
@property (weak, nonatomic) UILabel *titleLabel;
/// 支付日期
@property (weak, nonatomic) UILabel *paymentTimeLabel;
///
@property (weak, nonatomic) UILabel *accountTpyeLabel;
/// 金额
@property (weak, nonatomic) UILabel *accountLabel;

@end
@implementation SISSMyBrokerageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setWalletIncomeDetailModel:(SISSWalletIncomeDetailModel *)walletIncomeDetailModel {
    _walletIncomeDetailModel = walletIncomeDetailModel;
    
    self.titleLabel.text = walletIncomeDetailModel.itemDesc;
    self.paymentTimeLabel.text = walletIncomeDetailModel.insertTime;
//    self.accountTpyeLabel.text = @"";
    self.accountLabel.text = walletIncomeDetailModel.itemAmount;
    self.accountTpyeLabel.textColor = 1 ? [UIColor redColor] : COLOR(0x54CD78);
}

- (void)initUI {
    [super initUI];
    
    ///
    UILabel *titleLabel = [UILabel yyr_labelWithText:@"{姓名}首期" fontSize:15 textColor:MAIN_TEXT_COLOR];
    [self addSubview:titleLabel];
    self.titleLabel = titleLabel;
    
    /// 支付日期
    UILabel *paymentTimeLabel = [UILabel yyr_labelWithText:@"{支付日期}" fontSize:15 textColor:SECONDARY_TEXT_COLOR];
    [self addSubview:paymentTimeLabel];
    self.paymentTimeLabel = paymentTimeLabel;
    
    ///
    UILabel *accountTpyeLabel = [UILabel yyr_labelWithText:@"中介服务佣金（元）" fontSize:15 textColor:SECONDARY_TEXT_COLOR];
    [self addSubview:accountTpyeLabel];
    self.accountTpyeLabel = accountTpyeLabel;
    
    /// 账户金额
    UILabel *accountLabel = [UILabel yyr_labelWithText:@"+￥：5000.00" fontSize:15 textColor:[UIColor redColor]];
    [self addSubview:accountLabel];
    self.accountLabel = accountLabel;
}

- (void)initConstraint {
    [super initConstraint];
    
    CGFloat margin = 8.0;
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self).offset(2 * margin);
    }];
    
    [self.paymentTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-2 * margin);
        make.top.equalTo(self.titleLabel);
    }];
    
    [self.accountTpyeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(2 * margin);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(margin);
        make.bottom.equalTo(self).offset(-2 * margin);
    }];
    
    [self.accountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.accountTpyeLabel);
        make.right.equalTo(self).offset(-2 * margin);
    }];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
